<template>
  <div class="page-loading">
    <t-image class="image-container" fit="fill" :src="error"></t-image>
    <p class="loading-text">暂无数据</p>
  </div>
</template>

<script setup>
import { defineProps } from "vue";
import error from "@/assets/error.png";
// 接收外部控制的加载状态
const props = defineProps({
  isLoading: {
    type: Boolean,
    default: true,
  },
});
</script>

<style scoped lang="scss">
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 50vh;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .image-container {
    width: 35%;
  }
  .spinner {
    // width: 40px;
    // height: 40px;
    // border: 3px solid #f3f3f3;
    // border-top: 3px solid #409eff;
    // border-radius: 50%;
    // animation: spin 1s linear infinite;
  }

  .loading-text {
    margin-top: 16px;
    color: #666;
    font-size: 14px;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
</style>
